import 'package:flutter/material.dart';
import 'package:flutter_yfree/YFree.dart';

const zh = Locale("zh"), en = Locale("en");

String getLanguageTitle(Locale? locale) {
  if (locale == null) return "自动".yLocale();
  if (locale.languageCode == zh.languageCode) {
    return "中文(简体)";
  } else if (locale.languageCode == en.languageCode) {
    return "English";
  }
  return "";
}

String getLanguageImage(Locale? locale) {
  if (locale == null) return "";
  if (locale.languageCode == zh.languageCode) {
    return "images/icon_language_zh.png";
  } else if (locale.languageCode == en.languageCode) {
    return "images/icon_language_en.png";
  }
  return "";
}

final localizations = {
  "": {zh: "", en: ""},
  "自动": {zh: "自动", en: "Auto"},
};
